<form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
    <div class="layui-card-body">
        <div class="layui-form-item">
            <label class="layui-form-label">上传图片</label>
            <div class="layui-input-block">
                <input type="hidden"  name="photo" value="{$vo.photo|default=''}">
                <script>$('[name=photo]').uploadOneImage();</script>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">性别标题</label>
            <div class="layui-input-block">
                <input name="gender_name" value='{$vo.gender_name|default=""}' placeholder="请输入性别名称" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">文字颜色</label>
            <div class="layui-input-inline" style="width: 120px;">
                <input type="text" name="color" value='{$vo.color|default=""}'  placeholder="请选择颜色" class="layui-input" id="ID-colorpicker-demo-form-color">
            </div>
            <div class="layui-inline" style="left: -11px;">
                <div id="ID-colorpicker-demo-form"></div>
            </div>
        </div>
    </div>
    <div class="hr-line-dashed"></div>
    {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
    <div class="layui-form-item text-center">
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>
</form>
{block name='script'}
<script>
    layui.use(function(){
        var colorpicker = layui.colorpicker;
        var $ = layui.$;
        // 渲染
        colorpicker.render({
            elem: '#ID-colorpicker-demo-form',
            color: '{$vo.color|default="#1c97f5"}',
            done: function(color){
                $('#ID-colorpicker-demo-form-color').val(color);
            }
        });
    });
</script>
{/block}